package com.appwoo.txtws.wheel.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.appwoo.txtws.component.Logger;

public class PageListView extends ListView
{
  private static final int REFRESHING = 2;
  private static final String TAG = "PageListView";
  private static final int TAP_TO_REFRESH = 1;
  private boolean isNoMore = false;
  private LayoutInflater mInflater;
  private OnRefreshListener mOnLoadMoreListener;
  private RelativeLayout mRefreshMoreView;
  private ProgressBar mRefreshMoreViewProgress;
  private TextView mRefreshMoreViewText;
  private int mRefreshState;

  public PageListView(Context paramContext)
  {
    super(paramContext);
    init(paramContext);
  }

  public PageListView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    init(paramContext);
  }

  public PageListView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
  {
    super(paramContext, paramAttributeSet, paramInt);
    init(paramContext);
  }

  private void init(Context paramContext)
  {
    this.mInflater = ((LayoutInflater)paramContext.getSystemService("layout_inflater"));
    this.mRefreshState = 1;
    this.mRefreshMoreView = ((RelativeLayout)this.mInflater.inflate(2130903173, this, false));
    this.mRefreshMoreViewText = ((TextView)this.mRefreshMoreView.findViewById(2131493356));
    this.mRefreshMoreViewProgress = ((ProgressBar)this.mRefreshMoreView.findViewById(2131493354));
    this.mRefreshMoreView.setOnClickListener(new OnClickLoadMoreListener(null));
    addFooterView(this.mRefreshMoreView);
  }

  private void resetFooter()
  {
    if (this.mRefreshState != 1)
    {
      this.mRefreshState = 1;
      this.mRefreshMoreViewText.setText(2131428044);
      this.mRefreshMoreViewProgress.setVisibility(8);
    }
  }

  public boolean getIsNoMore()
  {
    return this.isNoMore;
  }

  public void hideFotterMoreView()
  {
    if (this.mRefreshMoreView == null);
    while (this.mRefreshMoreView.getVisibility() != 0)
      return;
    this.mRefreshMoreView.setVisibility(8);
    removeFooterView(this.mRefreshMoreView);
  }

  public void onLoadMore()
  {
    Logger.d("PageListView", "onLoadMore");
    if (this.mOnLoadMoreListener != null)
      this.mOnLoadMoreListener.onRefresh();
  }

  public void onLoadMoreComplete()
  {
    Logger.d("PageListView", "onLoadMoreComplete");
    resetFooter();
  }

  public void prepareForRefreshMore()
  {
    this.mRefreshMoreViewProgress.setVisibility(0);
    this.mRefreshMoreViewText.setText(2131428047);
    this.mRefreshState = 2;
  }

  public void setIsNoMore(boolean paramBoolean)
  {
    this.isNoMore = paramBoolean;
  }

  public void setOnLoadMoreListener(OnRefreshListener paramOnRefreshListener)
  {
    this.mOnLoadMoreListener = paramOnRefreshListener;
  }

  public void showFooterMoreView()
  {
    if (this.mRefreshMoreView == null);
    while (this.mRefreshMoreView.getVisibility() != 8)
      return;
    this.mRefreshMoreView.setVisibility(0);
    addFooterView(this.mRefreshMoreView);
  }

  private class OnClickLoadMoreListener
    implements View.OnClickListener
  {
    private OnClickLoadMoreListener()
    {
    }

    public void onClick(View paramView)
    {
      if (PageListView.this.mRefreshState != 2)
      {
        PageListView.this.prepareForRefreshMore();
        PageListView.this.onLoadMore();
      }
    }
  }

  public static abstract interface OnRefreshListener
  {
    public abstract void onRefresh();
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.wheel.widget.PageListView
 * JD-Core Version:    0.6.2
 */